import argparse
from prg.proc.control_thread import RunControl
from prg.bll.config_bll import ConfigBll
from prg.entity.arg_entity import ArgBase

ConfigBll.instance(path="../../config.yaml")
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--to", help="target name")
parser.add_argument("-l", "--local", help="local port")
parser.add_argument("-v", "--verification", help="verification key")
parser.add_argument("-e", "--encryption", help="encryption key")
arg = parser.parse_args()
if arg.to is None:
    arg.to = input("link to: ")
if arg.local is None:
    arg.local = input("link port: ")
if arg.verification is None:
    arg.verification = input("verification: ")
if arg.encryption is None:
    arg.encryption = input("encryption: ")
control = RunControl()
arg_val = ArgBase()
arg_val.arg_dict = arg.__dict__
control.send(name=arg.to, cmd="link", arg=arg_val)


